<script setup>
import { ref, onMounted } from 'vue'
import { useUserStore } from '@/stores'
import { useGetDeletedTasksService } from '@/api/task'

const userStore = useUserStore()
// 用户id
const { userId } = userStore
// 已删除任务列表
const deletedTasksList = ref([])
// 获取已删除任务列表
const getDeletedTasks = async () => {
  const res = await useGetDeletedTasksService({ user_id: userId })
  console.log('获取已删除任务列表：' + JSON.stringify(res.data.data))
  deletedTasksList.value = res.data.data
}
onMounted(() => {
  getDeletedTasks()
})
</script>

<template>
  <DeletedTasksContent @refreshTasks="getDeletedTasks" :taskList="deletedTasksList"></DeletedTasksContent>
</template>

<style lang="less" scoped>

</style>
